Fix condition for input format matching
Fix build with qmake and cmake
Incorrect return value