Added EOF case, fixed line number error