New patches needed for Shark Maven build and testing, as well as bugfixes

Also pulling some upstream changes.