On some counting questions for integral matrices