Made the typecaster except subclasses of the specified class

removed changes that weren't needed