Bug fixes

Bug fixes, added some crude logging, going to C:\Scripts\errors.log