various fixes and cleanups
cosmetics