Fix bug calling end on non variable
Merge pull request #104 from bukka/bug_expression_ref_pass

Fix bug: passing non variable to end function