Explicitly assigned readonly fields and fixed a weird conditional check.