Fix debug build on linux (type strictness).
Add regression test