Merge: Integer overflow and signedness fixes (Bug#8873).