Some little bugs fixes