made to work with CDH4.4 and fixed some issues in unit test cleanup