fixes for possible empty lines in input file