Fixes for errors from autograder.

The general pattern is that I'm not bottoming out my recursions at the
end. e.g. at 0 or []. Instead, I'm bottoming out at the level before tl
xs. Going upto the end yields a cleaner more robust and readable
solution.