added test, fixed some bugs
1.0.2