Fixed tests, also fixed case updating in periodic task