Fixed code for taking only legal action when there's only one.