Fixed a couple of bugs, more improvements.