Code optimizations and fixed typo

Different code optimizations without changing the behavior
Fixed typo
Optimized Auto-Check

Check only in configured timespan