Some fixes for site deploymentscript

Fixes #320.
Fixes #319.
Fixes #318.