Fixes for #20 & formatting fixes