Fixing problem to remove

Cast to int to avoid problens in remove method.