Hack to remove -inf input values