Added void error checking and fixed some other errors