some minor bug fixes, correction of opencv assert (I hope)