Uncomment error handler.
Remove bug in directory management.