PM functionality
Fixed null pointer exception
Merge branch 'master' into packet5pm