Fixed refercencing issues