Better finalize logic
And more finalize logic fixes