Fixed type propagation issues and wrong value in test program.