Gandalf setup fixes

Some fixes for the gandalf setup script