Added parsing for example file, fix error check.