Fixed handling of positional module parameters
Added "flatten" pass