Fixes

Hi  Daniel. Did some fixes. Program wouldn't even start without these.