Fixed a potential race condition (projectm).