Fixes a bug on Open311 UI Map Legend + some code improvements