gfl_parser.py: bugfix and test cases from bug report by Sam