rearraged a couple lines
renamed check_return_value(s) -> check_return_type(s)
updated README to document new API.