Fixed SQL result printing