Fixed some critical systems bugs