Fix bug with return value