Fixed memory leaks, bugs such as spinner and other minor bugs.