Fixed a typo and a crash