Merging in TfT_02's changes.

This should merge in the changes made by @TfT_02 in his current pull request.