Anomaly cancellation and self-dual lattices