fix MPS-19553: class cast exception due to mistake
fix MPS-19550 An exception gets endlessly reported in the console