fix build problems, fix scoping

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>