Small fixes, mark seen logic, and porting of some old code