Misc bug fixes

Small issues that needed fixing together