Fix geometry checking