Added assertion checks for stderr and return code