Fixed some template related problems

Signed-off-by: Kristian Duske <kristian.duske@gmail.com>
Fixed more problems with rendering system.

Signed-off-by: Kristian Duske <kristian.duske@gmail.com>