Fix an error parsing IF commands, fixes #715

This error was allowed to exist for far too long.