Fixes for wrong use of const causing PW.CAST_TO_QUALIFIED_TYPE defect in Coverity