Fixed bug in generation script