Fix for dimension calculations; minor additions in overlap algorithm itself