Bug fixes for latest changes