Unit tests for refresh method and possible fix for issue #9