bugfixes in preparesite.py