several small updates received from Koen
minor modifications to three files, received from Koen, with small improvements or increased robustness. These modifications will update the code to the latest version, and make it consistent with the version used in Bonn for the VIKING data.