Fixed bug with input file formatting

Input file can now be read correctly regardless of trailing commas or
not.