Fix up following bugs