Fix bug which was making incorrect type comparison.