silencing some compiler warnings

the old behavior of 9e62d6bf501f259a4b6cde5d2233795f427c5126 lead to an infinite loop.