Fix some build issues

Fixes #25 and some warnings about deprecated functions and dropped monadic results.