Add some unit tests, fix the "as" logic in KettleHelper