Circuit API bug fixes