bug fixes and opencv support