fix handling of status != 200
Merge remote-tracking branch 'origin/master'