Fixed several bugs in logicalmap. minor testing: seems to be working