Input parsing, detection and errors