Fix bug with clean page. Add test