Fixes and simplifications for the snippet() and highlight() functions.