fixed reading empty files
replace single carriage return characters with newline char
ignore the last newline char
fixed calculating source lines