Avoid awful exception in some edge cases