Fixed getelement() bug