fixed compile errors with template

even with a clean checkout I got lot's of warnings and couldn't fix it. It worked when moving the db cache it a separate file.