Fixed 'If-Then-Else' type.
Revert "Fixed 'If-Then-Else' type."

This reverts commit 62644db5e0d5742e3d3867d58e75be9b7e4d2292.
Fixed 'If-Then-Else' type resolution.
Updated the 'If-Then-Else' fix.
Added test infrastructure
Added test infrastructure
Merged from develop