Making src/test/java and fixing some bugs