fixed #70 and some more small bugs