code cleanup, fix various webapp client issues.