Explicitly assigned readonly fields and fixed a weird conditional check.
Merge pull request #254 from Therzok/master

Fix issues with unassigned readonly fields and a weird conditional check.