bugfixes to libcomplexity.sh