Cleaned up object merge code.