Add test code to test excpetions when initializing