Fixed some issues with challenge generation.