Fixed several unit tests to work in shadow builds