Fix bug in scanner setup process