Fixed some issues with overlay functionality.