Various improvements.
Removed stuff that wasn't being used.