Fixed a couple bugs, improved logging