Fix off-by-one error in internal string comparison
Fix spelling of two internal functions