Multiple small fixes