Fixed parser bug when file ends mid-function