Terminates function statements properly