Fixed web tests
Refactored stuff a bit