Added error checking to function, subroutine, and module end statements.