fixed a bug and a spelling error