Additional changes and bug fixes