Fixes bugs caused by previous commit