Fix error: conversion from 'int' to non-scalar type