Fix adding lockscreen targets.

The empty targets were not included in the setting properly.
Also make the code a little more memory efficient.
Merge remote-tracking branch 'upstream/jb-ras-mr2.0' into jb-ras-mr2.0