Fixed issue with mark_seen and optimised mark_all_seen