Updated testcases, several fixes

https://github.com/kuleszdl/SIFEI/issues/87
https://github.com/kuleszdl/SIFEI/issues/39