Remove null moves and adds when optimizing