Fixes issue #998.

Fixes multiple issues with the way PR #997 was implemented. 
@TShapinsky this is the `broadcast receiver` used to listen to the period preference update.