Reduced number of Register classes, added some error hanlding