change from dfaoliveira fork

Please, review my change.