Applied strict and fixed any global leaks as well as undefined variables #4