Fixed a problem that was causing crashes