Fix courtesy_yield edge case and others