Errors and log clean up