Fixed stale name.
Moved subword closer to its use. Fixed wrong function name. Fixed index error in subword.