Fixed crash at mapswitch