Fixed unchecked cast warnings