Update code, add missing return statement
Merge remote-tracking branch 'origin/beta' into beta