Cleaned up the closure grad code.