Fixes Routes, to make sure type is defined before making use of it. Closes #243