Fix an N+1 problem on #152