Fixed 'self-referencing' bug