Add build with dependencies to pom.xml and bug fix