Minor bug fixes

Fixes all the bugs. All of them.