Towards C implementation.
Fixed error pointed out by static analysis.