Fixes #354: handle logs more gracefully