Fixed bug that affected the automated surface constraint