Fix for #20 #22