Fixed Type conversion Error and Added More tests