fixed adress length; added 'return 0' on error.