Fixes for making code more pythonic, follow conventions