Clean up routing rules
Added proper error tracking for syntactically invalid expressions