Last set of fixes for #31