bootstrapped with a number of recent fixes (#365, #274, #362, #349) and other minor improvements