Fixed multiple system bugs