Some misc. fixes