Fix error handling and path of jar