Some Javascript bugs with dropdown