bugfixes to both externallib and tests to get the tests to run completely. the code is now green!