Fixed bug with loader setting "loader.curPri" after calling the functions