More error checking
Ensure bit indices are in correct order