Minor changes on pom, added more error handling