Fix memory leak
Fix unfreed bitmap
Minor memory leak fix
Clearer memory transfer.
Fix memory leaks when sending response about arrays