Fix type convertion error