Minor changes and bug fixes