Added check return code for shallow_flash.sh

fix #215
here as well, and 2 more places to fix below