Changed sample init; part of #254.