numerous small fixes. mws stub complete