Plugin generates faulty permalink URLs