small fixes, added testing