Fixed bug in decision alternative comparators; refactored cast and
instanceof classes