Added createElement, and minor fixes/changes.