Fixed nan-related test issue