Fix #661 - make type checks case insensitive