more minor changes and bug fixes