various fixes and additions