More bugs fixes