Fixes+optimization.