some minor changes and bug fixes