Type conversion errors removed and ambiguity of sqrt removed

Removed errors found in visual studio 2012