FYI @szczerba, this should resolve the failing renderer tests. A similar change must be done for the decoder.c as well I think, I'll try to look into that and add it to this MR.
Related to #109