The Chabauty-Coleman bound at a prime of bad reduction and clifford bounds for geometric rank functions