Updated to ensure rectangle always has non-zero dimension