Fix error message and list implementation, as suggested by code review.