Fix finalUrl not defined error
Fix url parsing

The equality operators were messed up.