Added element class and made some minor fixes