several bug fixes and new features.