Fix issue with device overlay being visible under some situations.