Updated with some fixes for #43