Fixed some weird bugs