Fixing UnsupportedOperation exception due to #283

Fix for #283 ava.lang.UnsupportedOperationException  at java.util.AbstractMap.put(AbstractMap.java:203) due to modifying an scala ImmutableMap