Merge "Fix null pointer exception" into pi-dev