Cleaned up the reference issues