Extension of #543

//cc @jagtalon