Moved init() code to open()