Fix treasure not generating in certain circumstances.