Modify some functions return value from `bool` to `int`