On Finite Rings, Algebras, And Error-Correcting Codes