Fix stop condition for GSPCA