Fixes for building and running tests