fixed log_command and added test for daemon argument