Repair tests and add checks for shell command result