Fix problems in for.test