Fixed error with private message to self, supressed warnings, slightly rearranged code