Improved testing coverage. There are failing tests yet