We found out the error occurs when we export the shapefiles with the M-value data, but the point doesn't have a M-value. If we export them without, it doesn't give us any trouble.

Edit: You can also edit the M-value afterwards in Q-Gis. Use the ''point editor'' tool to manually give the 'nan' values in the the M-value column a number value, for instance 0.