tests for SafeRouting spec and a bugfix