EN_saveinpfile was incorrectly saving the index of the GPV head loss curve inside of a simple control instead of the control status
EN_geterror doesn't take in the project wrapper, and you need to include maxLen