Fixing Java warnings