correcting some parsing issues and EOL