Made some more changes. These need to merged back into the master branch
soon.