fix missing return value
style improvements, thanks to Daniel Mack