Fix empty object handling