Remove code artifacts in encoder initialisation
Fix bug that causes infinite loop just before sleep