Avoid mean result out of range 0..359

Thanks to Jan Willem who spend time to figure out why we had out of range
numbers.