fix dangling problem with perfect helices and fix pylint warnings