Fix tests

See #1790, #1791