Fixed logging (close #20)