fix some initialization crashes