Avoid dision by zero - stelviewporteffect
fix potential bugs
revert changes for gui/*.cpp files