Fixing initialization order for objects