Fixed reference issues