Fix misc issues in the type descriptor builder

These are sufficient for us to pass the reflect package's (and a number of other packages') unit test suites.