Fixed bugs found with pyflakes which closes #14.