Fixed bugs in Wu's algorithm (fix #18)