Now corrects invalid gain values automatically. Added option to show logfile to the example app