Adding fix for cyclical variable replacement.
Added unit test to test the resolve props code.