Fix some minor bugs, and Python 3 compatibility
One style change `x if x else default` changed to `x or default` which is more idiomatic
Merge pull request #5 from harvimt/master

Fix some minor bugs, and Python 3 compatibility