several small fixes