Fix some memory bugs