I did some cleanup. Some if statements, return statements, buffer overruns, variables assigned to themselves. In some cases the same if statement was used twice and the top one would return without debug information. In other cases the "then" part is the same as the "else" part of the if statement. So you can take the else statements out.

There is more to follow soon.
Merge branch 'master' of https://github.com/qcerasmus/VTK.git