fixed invsee bug, and added some tests