serveral small fixes