Properly redirect bad-slug, non-HTML requests, fix script name output in JSON