Generalizations of Baxter's Theorem and Cubical Homology