Added more memory management code for CaBLAT