Farmer and building contractor fined for safety failings