Fix for Routes, make sure type is set before using it