Huge typo and bug fixes