Fixed a few smallish bugs