Fix wrapping.
Automatic length and height detection.
Cleaning up a few things.