Move initializing of properties from initialize() to constructor.

Closes #3776
Fix failing test cases.
Merge pull request #3777 from ADmad/bugfix-3776

Move initializing of properties from initialize() to constructor.