Fixed use of 'isAssignableFrom' plus tidy-up