Minor fixes for generating word array