Bug fixes for check 5