Sprite: Fixes for sprite map. (Issue #466)

Its still untested. We need test cases for sprite.