Adds a logger and some small fixes