Fix missing return in non-void functions

fix issue #148