Fixed return value of some functions