multiple fixes resolving all previously opened issues

multiple fixes resolving all previously opened issues

- invalid html output fixes.
- avatar problems fixes.
- division by zero error fixes.