Better loc url handling. Still fixing an output bug.