Fixing issue #22 and some indent fix for pep8 e128