Fix signed/unsigned mismatch warning, assertion in QCoreApplication