More bug corrections