investigating segfaultm small fixes