Bug fixes. Preinitialize all fields