Merge pull request #1502 from dennishendriksen/master

Fix FindBugs warnings, fix duplicate user adding, support multiple type aggregation
fix test