[DOC,FIX] Fixing most global functions that should not be global.