Updated the error checking function, and a few units
commited more files