Fixed bug in composition code