Backport missing types and clean up schema a bit.