Return correct code for error
Use correct name for struct entries
Don't confuse the scanner