Fix incorrect incldues
Remove unused code
Fix NPE