Document defensive code