Better error and erroneous input handling.