Fixes for #5252

Fixes for #5252 and refactoring. Perhaps you need to fix js validation too. I did not watch it.
The initial value is not needed because we explicitly require this property to be set.