Bug fix
Tests