Object allocation and deallocation now works in all cases. TODO: support for strings to be added.