Tail recursion optimization
Fix bug with default arguments