fix errors after optimization round