Handle more cases of non-literals in routes

Fixes #461