some bug fixes, ready for tinder and further testing