Fix return values

Return values are invalid in previous change. Correcting this.