Fix for the rect around coordinate function