Made the app Python 3 compatible.

Fixed some other minor issues as well.