Further fixes to .toMap