Fix unchecked cast