Fix a bug about function returning void.