Bug fixes and code cleanup/enhancements

Expand the long commit message for 0c1b294 (`bugfixes + code cleanup`) and your brain won't melt too badly.  :-)  

These were all the changes i made a couple months ago when i discovered `fakecloud`... decided to commit them and send them over in case you're interested!