fix bugs in blitbuffer implementation, fix unit test spec