Update init/deinit

Made a few changes to the "init", "deinit", and "deinit"window"
functions.