#1035: Cleanup and fix composer detection.
#1035: Cleanup and fix composer detection.