Fix method resolution order for modified classes