Fix compile errors for pullrequest #187