Fix for CodeInsight crashing Simba.

Also removed case-sensitivity from type comparison.