Added possibility of malformed input