Fixed writeProfilerMark in fragments, fixes #473.