Added protection against duplicated keys in key-value-mapping

http://manage.dimagi.com/default.asp?80598#674919
Should use `===` instead of `==`