Fixed bugs with last merge.