Fix slowness, crashing, error messages and other problems

Firefox crashes