Fix style
Add defensive code to avoid assertions violation reported on the console.