Fixed some minor bugs regarding type casting use in equality expressions