various fixes and improves