Bug fixes in the exact algorithm