Improve unit test to avoid unnecessary warnigns