Fix bugs with sos features