Minor javascript bug