Adding encoding information.

fixes #475
Setting right padding to 0.

We gain some space but it is still an incomplete solution.

fixes #476