Bug fixes while getting sanity to run