Adding two new Java samples and fixing some minor issues.