Work around a few Java unchecked warnings