Some fixes for map detection.