Minor fixes

See commit messages
why do we need the sleep?