Error handling

Making daemon stop if there is error in initialization.