fix complie warning
conversion to int from long unsigned int may alter its value
std::unique_ptr requires gcc 4.4