Fixes issue 35 and some other little bug