Fixed problem with int to double convertion