Fix target calculation from diff < 1.0 in test_hash()