No segfault, but no solution either. More work on expandstate needed