Add unit tests to try to reproduce #349 (but without success yet)