have you put breakpoint in openfromcommand ans stepped through?

are you sure the input functions are returning what you expect, from the file