Fixed bugs related to changes for #276