Fix some exceptions and finalize pom.xml