Various fixes after moving to msys