Cleaner error handler
Fixed warning