Fixed 'val' assertion