Fix scripts and tweak configuration files