patching non-termination bug in datatype factory, reported by Tiago

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