Move r ftdetect from after to ftdetect.