Improvements to likelihood weighting and general importance sampling