no real fixes made.
Added some logging capabilities. Doesn't work for some reason.