Fix cast

See #42 where merge was not as expected.