Fixed indentation of comment about NOSONAR
Enhanced 'instanceOf' methods to return the expected type