Fixed bugs in SO validation