Fixed 'Bug 12831 - Moving code around causes both an error and messed up UI'