Fix mark-in/mark-out bugs.