Fix 1800126. Use a loose_handle instead of a handle to prevent the layer being free...