Make object name extraction more robust