Merge "Fix wrong SafeUnref type" into pi-dev