Fixed zero and negative map generation bug.