Further fixes to blocktemplate
add extern