Sat add error check v2

As a result of the discussion in my pull request, "Sat add error checks #47",
I fixed my commits. Only 59d389b is a new one.