fixing a few issues, inclduing the ability to rebuild a type