Fixed Issue #1 patch direction detection.

This bug has been filed for five and a half years and I have finally
fixed it. By ghu it feels good.