First attempt at solving the encoding problem (see #15).