Fixes #2 and Fixes #3 while also cleaning up some code.