Cleanup old TODO marks, fix a potential bug