setup and library loading fixes