Changed daemon setup, added init hooks