Fix raw SQL usage on URL saving
Resolves #335