Make things work more logically

Add some tests