added some error checkin & updated tests