Re #6941. Clear compiler warning when template type is short int.

A warning had been appeared because a PropertyWithValue<uint16_t>
was being created. The reason for the warning is that the compiler
turns variables of this type into ints prior to arithmetic operations,
but then assigns back to the narrower type. In other cases the cast
will have no effect.
Re #6941. Clear MSVC compiler warning.
Re #6941. Remove unused variables.
Merge remote-tracking branch 'origin/feature/6941_compiler_warnings'