Tighten up madlib-select code