Fixed small behavior issues when API returned an error.