Fixed problems with badly merged changes (hopefully...)