small fixes for stability