Fixed a bunch of bugs

All such bugs prevented the file from importing