And a few more cleanups
Fixed a few small bugs