Fixed memory leaks and some warnings
Removed a comment in application
Merge with master