Misc fixes and stuff