Possible fix for issue with providing custom template upon initialization

I have moved the lines of code where the options are set to user provided or default options to before the 'setup' function is being called.