Fix NPE
Bug Fixes