Removed bugs causing crashes.