Fixes tail recursion elimination