Compilation improvements

Searches better default directories for OpenCV. Some compiler warnings
also removed.