Fix PierSample and improve it a bit