Fix handling maintenance mode