Added some tests & fixed bug in code generation for conversion formula.