Merge "Fix null pointer exceptions" into qt-dev