Code clearing, small fixes