Fix crash when copying static map (fixes #321)