Better logging (into one file), but done pretty ugly. Minor corrections