fixed compile errors under Ubuntu 12.04