Fixed API "object not initialized" error.