fix some pollution of namespace

fix problem with
https://github.com/BVLC/caffe/issues/769