Fixed cloning bug

- Fixed bug where a null pointer would be thrown when attempting to
clone a null value.