Fixes for the template define because i didnt test it good enough.