Use dynamic terminate handler
Fix build path irregularities