Contains no longer hangs on infinite lists

In answer to issue #280