Fix build w/ Qt 4.6, fix cppcheck issues