fix some bugs reading/writing units. uninitilized pointer in creep