fix lib path and syntax error in stat