Fixes upcase test case and adds tail recursion implementation.