Bug corrected

In some cases the GRAIN is missing in the output.