Fixed small bugs involving a case where one could choose illegal actions.