Add debugging information
Fix 500 on invalid link