Add build.xml, Fix some problems