Fix handling of empty error