fixed NPE exceptions and integrated additional group methods.