Adjusted comments and logging
Did minor cleanup in old functions to give more standardized error-handling