Multiple misc fixes