Fixed issue with space counting in read in