Fixed referencing issues