Fix an error in contains vs. containsKey

Not sure why this line changed, change it back to what it were.
Change the line 253 and 281 back to where it were before.

I didn't change those lines either, not sure whether it's coming from git merge