bug: fix crash when accessing uninitialized fields