Fix some bugs with user activation
Unit tests!