core: fix duplicate cast