various fixes and stuff