Needed to import sys to make the error handling work.

There's no testing of error handling yet, unfortunately … should probably do that soon!