Fixes collectOutputs function

Css and js blocks would not be picked up if they were not
inside a merge block (probably fails on other cases too)