Directly return 0 when the input string is '0'

This fixes an edge case that occurs when the input string is `'0'`.