Fix bug in divide to deal with empty values