Fixed double->int bug