Fixed functions.sh