Fixed "sample" method in maptools.py.