Miscellaneous bug fix

Now basically the code is able to pass the pylint scans.