Tweaked ftdetect