Some misc fixes