Lists: fix for typecasting bug in CONTAINS primitive