Fixed a few bugs

Mostly Ryan