bugfix for small num_words