Update logging

Also fix some small bugs