I was fiddling about with the sprite code a bit and managed to collect a bunch of fixes and cleanups. Some of there originated from my watermark work, but as I now have a bit more of them I figured it's high time to post them,