Fixed some problems caused by previous commit