Resize fixed again. More tests added.
Support encodings.