Some smaller cleanup
Implemented possible solution for case 10417