fix build problems with R 3.1 (issue 422)