fix a few things Aaron pointed out (<%=h is out, get rid of an extra DB call)