various improvements and bug fixes
various improvements and bug fixes