Cleanup

Cleanup and fix some small errors, now everything seems to work
better.