Should fix the duplicate log bug (fixes #22)