Fixed minor bugs and made compatible with changes to schFunc.py