UWE bug fix, and some cleanup