Added more error checking.

The first argument can now only be a list.