Fixed a bug with deallocated block.