Bug fixes and map iterator test