try to reduce binary size by linking to static libraries first
fix bad assertion