Added an additional assert for getting from an empty list.