Minor fixes to storage and dereferencing of data