Added a check for rval function closing parenthesis + 2 unit tests

This is the last parser change ;-). Champagne!