some fixes and add specs