Fixed missing log directory

This is #152 rebased on top of the latest master.