Improvements and bugfixes for generate blocks with local signals