various fixes and changes