bugfixes

fixes for
#32
#31
#13