fixes for building as a sub-module