Fix history file sink and add test
Fix #include guards comments for some tests