fixed #32; other minor fixes