Fixes and initial template code