cast enum to avoid warning
implemented type checking to ensure that custom classes actually extend the proper base class
Merge branch 'master' into feature-better-logging