Fixed a few bugs. Added (untested) Map type.