Corrected URL matching bug. Added tests.