Work around strange astype() numpy behavior.