Merge "Fix typecast" into pi-dev