some fixes in toMap, added isEmpty method