Rewrite layer parameters in shortlinks correctly

Fixes #762