Add comment support and enforce tail recursion.