BUG: Adding fix allowing for restoreContext to work independently of the ordering of classes in classtype.h