added dumpflags routine, added tests for remove trailing comment