Apply coding convention on new code
Fix issue that causes endless loop and breaks tests