Fixed a potential source of crashes.