Fix test, spelling in comment & simplify function