Minor reworking of code, and adding Bug report