Resource cleanup fixes.