fixing bugs in refactored code exposed from White's example

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