Patch for issue #291 (thanks to @eltjpm) + test changes