COMP: fixed misc small bugs