Changed the way liberties are checked to prevent errors.