small fixes for stability improvement