fix important errors, should stabilize otptimization