Several fixes for Mavericks