fix tiny memory leak
minor memory improvements