Uncommented some error handling that was accidentaly left out