Fixed issues with reference to Y