Fixes some things and adds serveral logging posibilitites