Code fixes per Laurent Alebarde's review