Fixes #20; cast had higher precedence than function call; reversed it