Fix import error and cleanup temporary file in exercise