Fix edge-cases.