Added suggestions from PR6068
Added suggestions from PR6068

As discussed here: https://github.com/Itseez/opencv/pull/6068#issuecomment-180797723
opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv