BUG: fix replace bug where different dtypes in a nested dict would only replace the first value