Fix and add test for maven