Minor bug fixes

These are just a few minor bug fixes I have done