Added wrapper for exec command and improved command status handling