Crash fix and more scanning
Scan after assembling
Merge pull request #3882 from Kingcom/BranchLines

Crash fix and more scanning