add host test, fix not writing all flat hosts