Strict in_array for mixed id variable types

Setting the in_array check to strict, as this would return true
incorrectly when and if values are of mixed type.
Add tests for #3545

Fix included in GH-1075

Closes #3545
Merge branch 'pr-1075'

Merge changes in pull request 1075.