I experienced an error with a bad gpx file, which did not contain any latitude / longitude at a certain time step.
Therefore made a change on line 98: making sure there are at least 4 elements in the line, before the fourth element is taken.
I had some gpx files with the extension .GPX (upper case). Therefore I made a change at line 73, this change makes it possible to select files regardless of the case of the extension.