Fixed some dictionary reference issues with deepcopy()