More build tweaks and fixes