Fix canvas crashes