Fix URLFor
Fix #12 and add tests for this.