Safe methods

Pulled in changes from @obromios after fixing the build issues in master. This obsoletes #23