Add tests and fix admin bugs

Fixes #140.