Wrote better checks for illegal actions.