Fix for python3 compatability. Closes #19.