Added inverted drive detection