Merge "Fix crash when loading resources without code" into pi-dev