Fix song and video COUNT and SUM queries