Removed some unchecked cast warnings from flat nj.