Fixed weird bugs