Used backported astype from utils.fixes