fix viewport for containers and add method tests