Made piece check more robust.