bug fixes

#51 and 50 fixed