Fixed a logic issue that popped up in testing with using "$this" in a different context. Also fixed a spelling error in documentation.