Fix adding lockscreen targets.

The empty targets were not included in the setting properly.
Also make the code a little more memory efficient.