Fix #353 properly this time.
Fix more edge cases in #contains().

This should fix issue #346 for good.
Merge remote-tracking branch 'origin/master' into bool-fix