Various stability/code cleanliness updates