added more spec and fixed several bugs uncovered by them