Added subroutine type checking