Implemented variable type speculation.

Bug: #44