Moved error checking to checkout()

Note: scripts now require a .ts at the end of the name!