Fix issue #304 in piston