bugs fixed at type inferencing
introducing tests