Minor fixes to compose utility function

and some code comments for @sebastianruder