Test for #309 which were fixed by #506