Various fixes and stuff