Fixed handling of HTTPErrors