Fixed band() logic. Added I/O tests.