Suppress unchecked cast warnings, and several other build warning fixes