Added restriction for .idea inside gitignore
Multiple bug fixes and pep-conditions