Added base case so it doesn't freak out on empty lists.

Added base case for issue #269.