Fix severall issues