bug fixes #2

Awesome job! Go ahead and merge this back into master.