Fixed wrong type collect statements.
Made type system work with new NBL analysis.