Memory issues

Fixed memory issues associated with new/delete member arrays in objects.