Did you make sure that there isn't something else instantiated as Relay(1)? If there's something somewhere else overwriting your value you could never see your output.
I would suggest adding printfs to make sure that the code is being reached like you think it is.
This type of problem is usually something silly that is overlooked, most likely in the place that you least expect.
You said that it worked in a smaller test bed. I'm assuming it was with the same physical hardware setup. It's worth checking
