Little bugfix in order generation