Fixed inactivity check.