Fixed issue with do and if blocks created when introducing error checking in function and subroutine end statements.