Fix x offset

When using other algorithm the x offset is not inverted