Fix errors

I fucked up the error checking earlier. This fixes that.