Fixed all_marked logic