Added support for End statement.
Re-applied commenting out of Catch count check which seemed to have disappeared in the recent repo issues.