Removed faulty demorgans implementation and added more unit tests