Fix VOI assert message on linux

Fixing #200 by moving the TreeId assignement before ensuring it is visible.