#23738: Fix and some improvements (consts in a separate file, fix in the build process, unused variable removed)