Minor changes and addition of error grabbing