Each case debugged, especially the is_composite() function.