fix roi exceptions, shape detection