Prevent using filter() on invalid types of values

Closes #75.