fix a few issues in etl