Update MiscFunctions.cpp