Fixes polling bug and tests.