Fixed cod so it works with new libraries