Added return values for most of the functions.
Merge pull request #161 from muzzel/master

Added return values for most of the functions.