Apply changes from commit a953ba8 to new parser code too.

The mentioned commit was applied before the merge of
opm-parser-integrate and therefore the changes did not carry over
to the code that uses the new parser. This code mimics the
changed behaviour for the new parser.

Closes issue #516
Fixed missed on occurence of number of samples
Merge pull request #517 from blattms/issue-516

Apply changes from commit a953ba8 to new parser code too.