Fix bug with type routing