Fix the GEM v302a data format
[Based on top of !130 (merged).]
This is a quite simple MR aiming at fixing some bugs discovered in the GEM v302a data format implementation. Its implementation should now be considered complete.
See commit messages for more details.