Minor tweaks for OpenCV compatibilty