Fix routing is_directory detection